#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    int a = 1;
    int b = 1;
    int c = 0;
    int count = 2;
    int find = 1;
    while (1)
    {
        count++;
        c = a + b;
        if (c == n)
        {
            printf("%d", count);
            return 0;
        }
        a = b;
        b = c;
        if (c > n)
        {
            find = 0;
            break;
        }
    }
    if (!find)
        printf("-1");
    return 0;
}